<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ClipPath</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">ClipPath()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>ClipPath</b></font>([Flags])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Clip the vector drawing output to the area defined by the current vector drawing path. 
Future drawing operations will only affect areas within the current path. The clipping 
will be combined with any clipping that previously existed on the drawing output. 
<br>
<br>
By default, the path is reset after calling this function. This can be prevented with the appropriate flags. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Flags (可选)</i></td>
<td width="90%"> 
 
Can be one of the following values: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Path_Default</font>     : No special behavior (default value)
  <font color="#924B72">#PB_Path_Preserve</font>    : Don't reset the path after this function
</font></pre>

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>备注</b></p><blockquote>



There is no "UnclipPath()" function: The clipping region of the drawing output can only be 
made smaller by adding further clipping, it cannot be made larger again. However, the clipping 
region can be saved and restored using the <a href="savevectorstate.html">SaveVectorState()</a> and <a href="restorevectorstate.html">RestoreVectorState()</a> functions 
respectively. So in order to apply temporary clipping to the drawing output, first save the 
drawing state and later restore it to go back to the original clipping regions. 

 

</blockquote><p><b>示例</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 200, "VectorDrawing", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    CanvasGadget</font>(0, 0, 0, 400, 200)
<font color="#3A3966">    LoadFont</font>(0, "Times New Roman", 20, <font color="#924B72">#PB_Font_Bold</font>)

    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartVectorDrawing</font>(<font color="#3A3966">CanvasVectorOutput</font>(0))
    
      <font color="#3A3966">; Setup a complex clipping path with nested ellipses (every second one will be clipped)</font>
      <b><font color="#3A3966">For</font></b> i = 10 <b><font color="#3A3966">To</font></b> 150 <b><font color="#3A3966">Step</font></b> 5
<font color="#3A3966">        AddPathEllipse</font>(200, 100, 2*i, i)
      <b><font color="#3A3966">Next</font></b> i
<font color="#3A3966">      ClipPath</font>()
    
      <font color="#3A3966">; Draw some text with this clipping</font>
<font color="#3A3966">      VectorFont</font>(<font color="#3A3966">FontID</font>(0), 150)      
<font color="#3A3966">      VectorSourceColor</font>(<font color="#3A3966">RGBA</font>(255, 0, 0, 255))
      
<font color="#3A3966">      MovePathCursor</font>(50, 25)
<font color="#3A3966">      DrawVectorText</font>("Text")

<font color="#3A3966">      StopVectorDrawing</font>()
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<p><img src="../HelpPictures/clippath.png"></p>

</blockquote><p><b>参阅</b></p><blockquote>


</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=beginvectorlayer.html>BeginVectorLayer()</a> - <a href="index.html">VectorDrawing Index</a> - <a href="closepath.html">ClosePath()</a> -&gt;<br><br>

</body></html>